﻿@model CloudStorageLight.Core.Web.CloudAccountVM

@{
    ViewBag.Title = CloudStorageLight.Core.Web.ViewMessages.MsgCreateCloudStorageLight;
    Layout = "~/Views/Shared/_LayoutAccount.cshtml";
    var demo = true ;
    var accountEntryMode = CloudStorageLight.Core.SystemSettings.Instance.MultiDomain && CloudStorageLight.Core.BlobService.GetCurrentDomain() =="";
}

<h2>@ViewBag.Title.</h2>
@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true, "", new { @class = "text-danger" })

    <div class="container">
        @if (accountEntryMode)
        {
            <div class="row">
                <div class="row-same-height">
                    <div class="col-md-2">
                        @(CloudStorageLight.Core.Web.ViewMessages.MsgCloudAccount)
                    </div>
                    <div class="col-md-5">
                        @Html.TextBoxFor(m => m.CloudAccount, new { @class = "form-control", placeholder = CloudStorageLight.Core.Web.ViewMessages.MsgCloudAccountHints })
                        @Html.ValidationMessageFor(m => m.CloudAccount, "", new { @class = "text-danger" })
                    </div>
                </div>
            </div>
            <input type="submit" id="createButton" value="@(CloudStorageLight.Core.Web.ViewMessages.CmdCreate)" class="btn btn-default" />

        }
        else
        {
            if (CloudStorageLight.Core.SystemSettings.Instance.MultiDomain)
            {
                <div class="row">
                    <div class="row-same-height">
                        <div class="col-md-2">
                            @(CloudStorageLight.Core.Web.ViewMessages.MsgCloudAccount)
                        </div>
                        <div class="col-md-5">
                            @Html.TextBoxFor(m => m.CloudAccount, new { @class = "form-control", @readonly = "readonly" })
                        </div>
                    </div>
                </div>
            }
            <div class="row">
                <div class="row-same-height">
                    <span class="col-md-2 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgEmail)</span>
                    <div class="col-md-5">
                        @Html.TextBoxFor(m => m.EMailAddress, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.EMailAddress, "", new { @class = "text-danger" })
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="row-same-height">
                    <span class="col-md-2 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgPassword)</span>
                    <div class="col-md-5">
                        @Html.PasswordFor(m => m.Password, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" })
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="row-same-height">
                    <span class="col-md-2 control-label">@(CloudStorageLight.Core.Web.ViewMessages.MsgConfirmPassword)</span>
                    <div class="col-md-5">
                        @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.ConfirmPassword, "", new { @class = "text-danger" })
                    </div>
                </div>
            </div>
            @*<div class="row">
                    <div class="row-same-height">
                        <div class="col-md-2">
                            @(CloudStorageLight.Core.Web.ViewMessages.MsgEmail)
                        </div>
                        <div class="col-md-5">
                            @(Model.EMailAddress)
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="row-same-height">
                        <div class="col-md-2">
                            @(CloudStorageLight.Core.Web.ViewMessages.MsgMailDomain)
                        </div>
                        <div class="col-md-5">
                            <p>@(Model.MailDomain)</p>
                            @Html.ValidationMessageFor(m => m.MailDomain, "", new { @class = "text-danger" })
                        </div>
                    </div>
                </div>*@
            if (demo)
            {
                <div class="row">
                    <div class="row-same-height">
                        <div class="col-md-7">
                            <p>
                                本サイトの利用はデモンストレーションの確認のみでご利用ください。本サイトは予告なく閉鎖・変更されます。
                                保存されたデータについても事前の予告なく削除します。また、機密情報を含むデータの保存はしないでください。
                                本サイトを利用して生じたいかなる損害に関しても、 当社は一切の責任を負わないものとします。
                            </p>
                            <p>
                                Please use in the use of this site is confirmation of the demonstration only . This site will be closed or changed without notice .
                                It deleted without prior notice also stored data . Also , please do not store data, including confidential information.
                                Please note that we shall not be responsible for any loss, damages and troubles.
                            </p>
                        </div>
                    </div>
                </div>
            }
            <hr />
            <div class="row">
                <div class="row-same-height">
                    <div class="col-md-7">
                        @if (demo)
                        {
                            <input type="submit" id="createButton" value="@(CloudStorageLight.Core.Web.ViewMessages.CmdCreate)" class="btn btn-default" disabled="disabled" />
                            <text>@Html.CheckBox("agree")上記に同意(agree)</text>

                        }
                        else
                        {
                            <input type="submit" id="createButton" value="@(CloudStorageLight.Core.Web.ViewMessages.CmdCreate)" class="btn btn-default" />
                        }
                    </div>
                </div>
            </div>
            @*<div class="row">
                <div class="row-same-height">
                    <div class="col-md-7">
                    </div>
                    <div class="col-md-5">
                        @Html.ActionLink(CloudStorageLight.Core.Web.ViewMessages.MsgCreatePrivateCloudStorageLight, "CreatePrivateCloudAccount")
                    </div>
                </div>
            </div>*@

        }

    </div>

}

<script type="text/javascript">
    $('#agree').change(function () {
        if ($(this).is(':checked')) {
            $('#createButton').removeAttr('disabled');
        } else {
            $('#createButton').attr('disabled', 'disabled');
        }
    });
</script>